1. Field of the Invention
The present invention relates to an electronic device, a method of controlling an external device using the electronic device, a program, and a storage medium, and more specifically relates to an electronic device that controls the power supply of a connected external device, a method of controlling the external device with the electronic device, a program, and a storage medium.
2. Description of the Related Art
As a method of connecting electronic devices to each other according to the related art, USB (universal serial bus) connections have become widespread. USB forms a connection with serial communications between a host machine and a plurality of external devices. For example, Japanese Patent Laid-Open No. 2001-67156 discloses technology related to the connection of a computer used as a host machine and a digital camera used as an external device.
A plug-and-play function (a function to automatically identify the connection relationship with an external device when the external device is newly connected or removed) is a feature of a USB connection. A USB connection is further characterized by having a hot-swap function (referred to as a livewire insertion/removal function, in which the external device can be connected or removed with power left turned on), and a power supply function to supply power to the external device. It is thought that with these functions, power supply and setting of an address and ID number when a user connects an electronic device and an external device are not burdensome.
Incidentally, in a USB connection, devices are connected with a special connector that connects a total of four electrical wires, including a 5V power source referred to as a VBUS, a ground line, and two signal lines D+ and D−. There is naturally a limit to the value of the current that can be supplied with the power source; the current is limited by USB connection standards to 100 mA to 500 mA. (However, the current value is 500 mA in the case of a device that requires power from a VBUS, and 100 mA in the case of a self-powered device.)
Also, in USB connection standards, it is defined that a connected device is required to switch to a suspend state, which is a low power consumption mode, due to a command from the host machine. In this suspend state, it is prescribed that the voltage consumption from the VBUS must be reduced to at least 500 μA. Also, there is a resume operation for recovering to a normal state from the suspend state. In USB connection standards, it is prescribed that a device with a USB connection recovers from the suspend state due to the host machine transmitting a resume signal for 20 milliseconds.
Conventionally, in a USB connection, a personal computer (also referred to as a PC) is used as a host machine. However, it has become possible to make a connection between all manner of electronic devices using a USB connection, and so there are instances when not only a PC but another electronic device is also used as a host machine. It is conceivable to connect an external device to that other electronic device. In that case, it is necessary that the other electronic device used as a host machine be able to supply power to the connected external device. As in the related art, when a PC is used as the host machine of a USB connection, adequate power supply is provided by the PC, so it is not necessary to pay much attention to power management.
However, when a battery operated portable electronic device such as a digital camera is used as the host machine of a USB connection, and an external device is connected to the portable electronic device, it is necessary to execute power management of the entire system configured from the portable electronic device and the external device. That is, in this sort of case, it is necessary to actively lower power consumption through the use of the above suspend state.
USB connection devices connected as an external device include many devices that do not meet USB standards for a suspend state. For example, at present there are devices that, even in a suspend state, require supply of a voltage greater than 500 μA from the host machine, and devices that cannot recover (resume) from the suspend state.
Also, among devices with a USB connection, in a device such as an HDD (Hard Disk Drive), when resuming, USB communications recover within a prescribed time. However, there are also devices that require at least a few seconds from the time that an internal magnetic disk begins to rotate until the time that actual read/write operation can be resumed. When, using such a device, shooting (i.e. image capture) is performed with a digital camera used as a host machine immediately after recovering from the suspend state, the timing of shooting may be affected. For an electronic device requiring a fast response such as a digital camera, the time from the suspend state until the device is usable is an important point that greatly affects performance.